export default {
  props: {
    headerTools: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    makeHeaderTools(h) {
      return this.headerTools.map((tool) => {
        return h(tool.component, {
          props: tool.props,
        })
      })
    },
    makeCardHeader(h) {
      const tools = this.makeHeaderTools(h)
      return tools.length > 0
        ? h('div', { slot: 'header' }, [tools])
        : ''
    },
  },
}
